// @ts-nocheck
import { createStore, applyMiddleware } from 'redux'
import reducer from './reducer'
import createSafaMiddleware from '../redux-saga'
import logger from 'redux-logger'
import { asyncIncrease, increase, decrease, asyncDecrease, autoIncrease, stopAutoIncrease } from './action/counter'
// import { createChangeAction } from './action/student/searchCondition'
// import { fetchStudents2 } from './action/student/searchResult'
import rootSaga from "./mySaga"

const sagaMid = createSafaMiddleware() // 创建一个saga的中间件
const store = applyMiddleware(sagaMid, logger)(createStore)(reducer)

// 启动saga任务
sagaMid.run(rootSaga, 1, 2)

setTimeout(() => {
    store.dispatch(asyncIncrease())
}, 2000)


export default store